package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.ruoyi.system.domain.csqaq.Alteration;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 饰品异动Mapper接口
 *
 * @author ruoyi
 * @date 2025-10-04
 */
@Repository
public interface AlterationMapper extends BaseMapper<Alteration> {

    @Insert("<script>" +
            "INSERT INTO alteration (" +
            "id, goodid, img, name, yyyp_sell_price, yyypid, buffid, monitor_key, " +
            "origin, target, difference, target_sell_price, origin_sell_price, " +
            "origin_sell_num, target_sell_num, origin_buy_num, target_buy_num, " +
            "origin_buy_price, target_buy_price, created_at, status " +
            ") VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(" +
            "#{item.id}, #{item.goodid}, #{item.img}, #{item.name}, #{item.yyypSellPrice}, " +
            "#{item.yyypid}, #{item.buffid}, #{item.monitorKey}, #{item.origin}, " +
            "#{item.target}, #{item.difference}, #{item.targetSellPrice}, " +
            "#{item.originSellPrice}, #{item.originSellNum}, #{item.targetSellNum}, " +
            "#{item.originBuyNum}, #{item.targetBuyNum}, #{item.originBuyPrice}, " +
            "#{item.targetBuyPrice},#{item.createdAt},#{item.status}" +
            ")" +
            "</foreach>" +
            "</script>")
    int batchInsert(List<Alteration> list);
}
